<template>
  <common-info-dialog :visible.sync="dialogShow" @cancel="close" :title="dialogTitle" :infoLoading="infoLoading">
    <common-info-table>
      <common-info-table-cell label="字典名称">{{ form.dictLabel }}</common-info-table-cell>
      <common-info-table-cell label="字典类型">{{ form.dictName }}</common-info-table-cell>
      <common-info-table-cell label="内容">{{ form.dictValue }}</common-info-table-cell>
      <common-info-table-cell label="字典类型编号">{{ form.dataDictCode }}</common-info-table-cell>
<!--      <common-info-table-cell label="状态">{{ form.status === '0' ? '正常' : '停用' }}</common-info-table-cell>-->
      <common-info-table-cell label="创建时间">{{ form.createTime }}</common-info-table-cell>
<!--      <common-info-table-cell label="创建者">{{ form.createBy }}</common-info-table-cell>-->
      <common-info-table-cell label="更新时间" v-if="form.updateTime">{{ form.updateTime }}</common-info-table-cell>
<!--      <common-info-table-cell label="更新者" v-if="form.updateBy">{{ form.updateBy }}</common-info-table-cell>-->
      <common-info-table-cell label="备注">{{ form.remark }}</common-info-table-cell>
    </common-info-table>
  </common-info-dialog>
</template>

<script>
import { dict_data_getDictDataInfo } from '@/api/management/configure/index.js'

export default {
  components: {},
  props: {},
  data() {
    return {
      dialogTitle:"字典数据详情",
      dialogShow: false, // 是否显示
      form: {},
      infoLoading: false,
    }
  },
  watch: {},
  computed: {},
  methods: {
    /**
     * 关闭
     */
    close() {
      this.dialogShow = false
    },
    /**
     * 显示
     */
    show(dictCode) {
      this.dialogShow = true
      this.dialogTitle="字典数据详情"
      this.infoLoading = true
      this.dict_data_getDictDataInfo(dictCode)
    },
    dict_data_getDictDataInfo(code) {
      dict_data_getDictDataInfo({ dictCode: code }).then((res) => {
        if(res && res.code === 200) {
          this.form = res.data
          this.infoLoading = false
        } else {
          this.$GlobalErrorConfirm('获取信息失败', res.msg, '重新加载').then(() => {
            this.dict_data_getDictDataInfo(code)
          })
        }
      })
    },

  }
}
</script>
<style lang="scss" scoped>
</style>
